package com.lfy.modules.safety.limit.strategy;

import com.lfy.modules.common.intercept.AuthHandlerInterceptor;
import com.lfy.modules.common.utils.RequestUtil;


/**
 * 限流策略
 *
 * @author <a href="https://www.lvfeiy.top">lvfeiyang</a>
 * @date 2023/10/16 15:12
 */

public enum LimitStrategyEnum {
    Ip{
        @Override
        public String toDo() {
           return RequestUtil.getLimitIpKey();
        }
    },
    Id{
        @Override
        public String toDo() {
            return AuthHandlerInterceptor.authLocal.get().getId().toString().concat("@").concat(RequestUtil.getUri());
        }
    }
    ;

    public abstract String toDo();
}
